<template>
  <div class="qin-home">
    <div class="head-count">
      <div class="count">
        <span class="count-money">元</span>
        <ul>
          <li v-for="totalMoneyA in totalMoney" v-bind:class="{'xiaoshudian': totalMoneyA == '.'}">{{totalMoneyA}}</li>
        </ul>
        <span>累计捐款</span>
      </div>
      <div class="count-text">
        共青团江西省委官方主办
      </div>
    </div>
    <!--轮播图部分-->
    <div class="head-main">
      <swiper :aspect-ratio="300/800" auto loop>
        <swiper-item class="swiper-demo-img" v-for="(item, index) in imglist" :key="index">
          <!--@click="goProject('imgOne')"-->
          <img :src="imageUrl.imageUrl + item.carouselPicUrl" @click="goProject(item.carouselUrl, 'lunbo')">
        </swiper-item>
      </swiper>
    </div>
    <!--推荐项目-->
    <div class="content">
      <div class="content-left float-left" v-for="eventLists in eventList" @click="goProject(eventLists.id)">
        <div class="content-left-img img-right">
          <img :src="imageUrl.imageUrl + eventLists.eventPicUrl"/>
        </div>
        <p v-html="eventLists.eventName"></p>
        <div class="content-progress">
          <x-progress class="progresss" :percent="eventLists.schedule" :show-cancel="false"></x-progress>
          <span class="progress-right">{{eventLists.schedule}}%</span>
        </div>
        <!--<div class="content-foot">-->
        <!--<span class="content-foot-left">我要捐款</span>-->
        <!--<span class="content-foot-right">邀朋友一起捐</span>-->
        <!--</div>-->
      </div>
    </div>
    <!--<div class="fourTab">
      <ul>
        <router-link to="/findrank"><li style="background-color: #50c5f1">
          <div class="fourTab-listOne">
            <i class="iconfont">&#xe633;</i>    <span>捐赠排名</span>
          </div>
        </li></router-link>
        <router-link to="/oneToOneDonation"><li style="background-color: #93d876">
          <div class="fourTab-listOne">
            <i class="iconfont" style="font-size: 34px;padding-bottom: 6px;display: inline-block;">&#xe63e;</i> <span>一对一捐助</span>
          </div>
        </li></router-link>
        <router-link to="/batch"><li style="background-color: #f6751e">
          <div class="fourTab-listOne">
            <i class="iconfont" style="font-size: 26px;display: inline-block;padding-bottom: 4px;">&#xe67f;</i> <span>批量捐助</span>
          </div>
        </li></router-link>
        <router-link to="/findmessage"><li style="background-color: #7f46d8">
          <div class="fourTab-listOne">
            <i class="iconfont" style="font-size: 24px;display: inline-block;padding-bottom: 4px;padding-right: 10px;">&#xe634;</i> <span>信息公开</span>
          </div>
        </li></router-link>
      </ul>
    </div>-->
    <div class="home-list">
      <ul>
        <li>
          <i class="iconfont" v-if="quanbu === true" @click="changeProjectType('quanbu')">&#xe602;</i>
          <i class="iconfont" v-else @click="changeProjectType('quanbu')">&#xe604;</i>
          <!--604-->
          <p>全部</p>
        </li>
        <li>
          <i class="iconfont" v-if="zhukun === true" @click="changeProjectType('zhukun')">&#xe60a;</i>
          <i class="iconfont" v-else @click="changeProjectType('zhukun')">&#xe60b;</i>
          <!--60a-->
          <p>助困</p>
        </li>
        <li>
          <i class="iconfont" v-if="zhuxue === true" @click="changeProjectType('zhuxue')">&#xe607;</i>
          <i class="iconfont" v-else @click="changeProjectType('zhuxue')">&#xe609;</i>
          <!--607-->
          <p>助学</p>
        </li>
        <li>
          <i class="iconfont" v-if="zhuyi === true" @click="changeProjectType('zhuyi')">&#xe606;</i>
          <i class="iconfont" v-else @click="changeProjectType('zhuyi')">&#xe60c;</i>
          <!--606-->
          <p>助医</p>
        </li>
        <li>
          <i class="iconfont" v-if="qita === true" @click="changeProjectType('qita')">&#xe603;</i>
          <i class="iconfont" v-else @click="changeProjectType('qita')">&#xe605;</i>
          <!--603-->
          <p>其他</p>
        </li>
      </ul>
    </div>
    <div class="home-tab">
      <!--<tab :line-width=2 v-model="index">-->
      <!--<tab-item class="vux-center" :selected="demo === '近期项目'" @on-item-click="witchEvent('jinqi')">-->
      <!--<span :class="{'home-active': isA}">近期项目</span>-->
      <!--</tab-item>-->
      <!--<tab-item class="vux-center" @on-item-click="witchEvent('wangqi')">-->
      <!--<span :class="{'home-active': isB}">往期项目</span>-->
      <!--</tab-item>-->
      <!--</tab>-->
      <div @click="goProject(eventListJqs.id)" v-for="(eventListJqs, index) in eventListQB">
        <flexbox>
          <flexbox-item :span="4">
            <div class="flex-demo">
              <img :src="imageUrl.imageUrl + eventListJqs.eventPicUrl"/>
            </div>
          </flexbox-item>
          <flexbox-item>
            <div class="flex-demo">
              <p v-html="eventListJqs.eventName"></p>
              <x-progress :percent="eventListJqs.schedule" :show-cancel="false"></x-progress>
              <span class="precess-right">{{eventListJqs.schedule}}%</span>
              <div class="project-foot">
                <span class="project-foot-left">目标<span
                  class="content-red">{{eventListJqs.eventGoalAmount}}</span>元</span>
                <span class="project-foot-left">参加<span
                  class="content-red">{{eventListJqs.attendPeople}}</span>人次</span>
              </div>
            </div>
          </flexbox-item>
        </flexbox>
      </div>
      <div class="moreEvent" @click="whichGoMore()" v-model="noMoreEvent">{{noMoreEvent}}</div>
      <!--<div @click="goProject('swiperRightOne')">-->
      <!--<flexbox>-->
      <!--<flexbox-item :span="4">-->
      <!--<div class="flex-demo">-->
      <!--<img src="../images/head-li.png"/>-->
      <!--</div>-->
      <!--</flexbox-item>-->
      <!--<flexbox-item>-->
      <!--<div class="flex-demo">-->
      <!--<p>梦想足球场 圆农村孩子的足球梦</p>-->
      <!--<x-progress :percent="percent3" :show-cancel="false"></x-progress>-->
      <!--<span class="precess-right">60%</span>-->
      <!--<div class="project-foot">-->
      <!--<span class="project-foot-left">目标<span class="content-red">3000</span>元</span>-->
      <!--<span class="project-foot-left">参加<span class="content-red">3000</span>人次</span>-->
      <!--</div>-->
      <!--</div>-->
      <!--</flexbox-item>-->
      <!--</flexbox>-->
      <!--</div>-->
      <!--<swiper v-model="index" :show-dots="false">-->
      <!--&lt;!&ndash;tab左边&ndash;&gt;-->

      <!--<swiper-item>-->

      <!--</swiper-item>-->


      <!--&lt;!&ndash;tab右边&ndash;&gt;-->
      <!--<swiper-item>-->

      <!--</swiper-item>-->
      <!--</swiper>-->
    </div>
    <!--<toast v-model="showToast" width="8.5rem" type="success" :time="2000" position="middle"><p>今日登录</p> 获得<span-->
      <!--v-model="integral">{{integral}}</span>积分-->
    <!--</toast>-->

    <div style="width: 100%;height: 66px"></div>
    <nav-bottom></nav-bottom>
  </div>
</template>

<script>
  import navBottom from './common/nav-bottom.vue';
  import './index.scss';

  import XHeader from 'vux/src/components/x-header/index.vue'
  import Swiper from 'vux/src/components/swiper/swiper.vue'
  import SwiperItem from 'vux/src/components/swiper/swiper-item.vue'
  import XProgress from 'vux/src/components/x-progress/index.vue'
  import Tab from 'vux/src/components/tab/tab.vue'
  import TabItem from 'vux/src/components/tab/tab-item.vue'
  import Sticky from 'vux/src/components/sticky/index.vue'
  import Flexbox from 'vux/src/components/flexbox/flexbox.vue'
  import FlexboxItem from 'vux/src/components/flexbox/flexbox-item.vue'

  import CONSTANT from '@/common/constants.js'
  import http from '@/common/http.js'

  const list = () => ['近期项目', '往期项目']
  export default {
    name: 'Hello',
    data() {
      return {
        totalMoney: ["0", "0", "0", "0", "0", "0", "0", "0", ".", "0", "0",],
        imglist: [{id: "", carouselStatus: "", carouselUrl: "", carouselPicUrl: ""}, {
          id: "",
          carouselStatus: "",
          carouselUrl: "",
          carouselPicUrl: ""
        }],
        eventList: [],
        eventListQB: [],
        eventListJq: [],
        eventListWangqi: [],
        poolListJq: [],
        poolListWangqi: [],
        studyListJq: [],
        studyListWangqi: [],
        medicineListJq: [],
        medicineListWangqi: [],
        otherListJq: [],
        otherListWangqi: [],
        pageNoJinqi: 1,
        pageNoWangqi: 1,
        allNoJinqi: 1,
        allNoWangqi: 1,
        poolNoJinqi: 1,
        poolNoWangqi: 1,
        studyNoJinqi: 1,
        studyNoWangqi: 1,
        medicineNoJinqi: 1,
        medicineNoWangqi: 1,
        otherNoJinqi: 1,
        otherNoWangqi: 1,

        noMoreEvent: '点击加载更多',

        pageSize: 5,
        event_type: '',
//        判断往期还是近期
        witchGo: 'jinqi',
        index: 0,
        demo: '近期项目',
//      tab选中时绑定的样式
        isA: true,
        isB: false,
        showToast: false,
        integral: '10',
        // 类型选择
        quanbu: true,
        zhukun: false,
        zhuxue: false,
        zhuyi: false,
        qita: false,

        userId: ''
      }
    },
    components: {
      navBottom,
      XHeader,
      Swiper,
      SwiperItem,
      XProgress,
      Tab,
      TabItem,
      Sticky,
      Flexbox,
      FlexboxItem
    },
    activated () {
      console.log(this)
      if (this.$emit('ShareAppMessage')) {
        this.$emit('ShareAppMessage', '青援筹', '“青援筹”由江西团省委、青基会发起设立，通过众筹善款，服务青少年成长。', 'http://qyc.jxyouth.org.cn/a/wxinterface/wxOAuth', 'http://qyc.jxyouth.org.cn/userfiles/jijinhuibiaozhi.png')
      }
      if (this.$emit('MenuShareTimeline')) {
        this.$emit('MenuShareTimeline', '青援筹', 'http://qyc.jxyouth.org.cn/a/wxinterface/wxOAuth', 'http://qyc.jxyouth.org.cn/userfiles/jijinhuibiaozhi.png')
      }
    },
    mounted() {
//      console.log(this.imageUrl.imageUrl)
//      var openNum = sessionStorage.getItem('openNum')
//      if (openNum == null || openNum == '' || openNum == 'undefined' || openNum == 0) {
//        window.location.href = 'http://qyc.jxyouth.org.cn/a/wxinterface/wxOAuth'
//        window.sessionStorage.setItem('openNum', 1)
//      }
      var openid = sessionStorage.getItem("openid");
      if (openid == null || openid == '' || openid == 'undefined') {
        sessionStorage.setItem('openid', this.$route.query.openId)
        sessionStorage.setItem('userId', this.$route.query.userId)
        sessionStorage.setItem('wxAvatar', this.$route.query.wxAvatar)
        sessionStorage.setItem('nickName', this.$route.query.nickName)
      }
      console.log(sessionStorage.getItem("openid"))
      console.log(sessionStorage.getItem("userId"))
      console.log(sessionStorage.getItem("wxAvatar"))
      console.log(sessionStorage.getItem("nickName"))
      this.userId = window.sessionStorage.getItem('userId')
//      http.post(CONSTANT.SIGN, {userId: this.userId}, (res) => {
//        console.log(res)
//        if (res.code == 200) {
//          if (res.errmsg == '今日已登录') {
////          this.showToast = false
//          } else if (res.errmsg == '首次登录成功') {
//            this.showToast = true
//            this.integral = res.obj.integral
//          }
//        }
//      })
      http.post(CONSTANT.TOTAL_MONEY, {}, (res) => {
        // 累计捐款请求
        if (res.code == 200) {
          let totalMoneyArr = [];
          for (let i = 0; i < res.obj.totalMoney.length; i++) {
            let n = res.obj.totalMoney.substring(i, i + 1)
            totalMoneyArr.push(n)
          }
          ;
          this.totalMoney = totalMoneyArr;
        }
        ;
      });
      http.post(CONSTANT.CAROUSEL_LIST, {}, (res) => {
//        轮播图请求
        if (res.code == 200) {
          console.log(res, 'lu')
          this.imglist = res.list;
        }
      })
      http.post(CONSTANT.EVENT_RECOMMEDN, {}, (res) => {
//        推荐项目请求
        if (res.code == 200) {
          this.eventList = res.list
        }
      })
//      近期项目请求
      this.pageNoJinqi = this.allNoJinqi;
      this.pageNoWangqi = this.allNoWangqi;
//      this.goEVENT_LISTWq();
      this.goEVENT_LIST();
    },
    methods: {
      goEVENT_LIST() {
        //      近期项目请求
        this.witchGo = 'jinqi';
        http.post(CONSTANT.EVENT_LIST, {
          event_type: this.event_type,
          pageNo: this.pageNoJinqi,
          pageSize: this.pageSize
        }, (res) => {
          console.log(res)
          if (res.code == 200) {
            if (res.errmsg == '没有更多的项目') {
              this.noMoreEvent = '没有更多的项目了'
              return
            } else if (res.errmsg == '') {
              this.noMoreEvent = '点击加载更多'
            }
            if (this.event_type == '') {
              if (this.allNoJinqi == 1) {
                this.eventListJq = res.list;
                this.eventListQB = this.eventListJq;
              } else {
                this.eventListJq = this.eventListJq.concat(res.list);
                this.eventListQB = this.eventListJq;
              }
            } else if (this.event_type == 'pool') {
              if (this.poolNoJinqi == 1) {
                this.poolListJq = res.list;
                this.poolNoJinqi++
                this.eventListQB = this.poolListJq;
              } else {
                this.poolListJq = this.poolListJq.concat(res.list);
                this.poolNoJinqi++
                this.eventListQB = this.poolListJq;
              }
            } else if (this.event_type == 'study') {
              if (this.studyNoJinqi == 1) {
                this.studyListJq = res.list;
                this.studyNoJinqi++;
                this.eventListQB = this.studyListJq
              } else {
                this.studyListJq = this.studyListJq.concat(res.list);
                this.studyNoJinqi++;
                this.eventListQB = this.studyListJq
              }
            } else if (this.event_type == 'medicine') {
              if (this.medicineNoJinqi == 1) {
                this.medicineListJq = res.list;
                this.medicineNoJinqi++;
                this.eventListQB = this.medicineListJq
              } else {
                this.medicineListJq = this.medicineListJq.concat(res.list);
                this.medicineNoJinqi++;
                this.eventListQB = this.medicineListJq
              }
            } else if (this.event_type == 'other') {
              if (this.otherNoJinqi == 1) {
                this.otherListJq = res.list;
                this.otherNoJinqi++;
                this.eventListQB = this.otherListJq
              } else {
                this.otherListJq = this.otherListJq.concat(res.list);
                this.otherNoJinqi++;
                this.eventListQB = this.otherListJq
              }
            }
          }
        })
      },
      goEVENT_LISTWq() {
        // 往期项目请求
        this.witchGo = 'wangqi';
        http.post(CONSTANT.EVENT_PAST, {
          event_type: this.event_type,
          pageNo: this.pageNoWangqi,
          pageSize: this.pageSize
        }, (res) => {
          console.log(res)
          if (res.code == 200) {
            if (res.errmsg == '没有更多的项目') {
              this.noMoreEvent = '没有更多的项目了'
              return
            } else if (res.errmsg == '') {
              this.noMoreEvent = '点击加载更多'
            }
            if (this.event_type == '') {
              if (this.allNoWangqi == 1) {
                this.eventListWangqi = res.list;
                this.allNoWangqi++
                this.eventListQB = this.eventListWangqi;
//                if (this.allNoJinqi != 1) {
//                  this.eventListQB = this.eventListWangqi;
//                }
              } else {
                this.eventListWangqi = this.eventListWangqi.concat(res.list);
                this.allNoWangqi++
                this.eventListQB = this.eventListWangqi;
              }
            } else if (this.event_type == 'pool') {
              if (this.poolNoWangqi == 1) {
                this.poolListWangqi = res.list;
                this.poolNoWangqi++
                this.eventListQB = this.poolListWangqi;
              } else {
                this.poolListWangqi = this.poolListWangqi.concat(res.list);
                this.poolNoWangqi++
                this.eventListQB = this.poolListWangqi;
              }
            } else if (this.event_type == 'study') {
              if (this.studyNoWangqi == 1) {
                this.studyListWangqi = res.list;
                this.studyNoWangqi++;
                this.eventListQB = this.studyListWangqi
              } else {
                this.studyListWangqi = this.studyListWangqi.concat(res.list);
                this.studyNoWangqi++;
                this.eventListQB = this.studyListWangqi
              }
            } else if (this.event_type == 'medicine') {
              if (this.medicineNoWangqi == 1) {
                this.medicineListWangqi = res.list;
                this.medicineNoWangqi++;
                this.eventListQB = this.medicineListWangqi
              } else {
                this.medicineListWangqi = this.medicineListWangqi.concat(res.list);
                this.medicineNoWangqi++;
                this.eventListQB = this.medicineListWangqi
              }
            } else if (this.event_type == 'other') {
              if (this.otherNoWangqi == 1) {
                this.otherListWangqi = res.list;
                this.otherNoWangqi++;
                this.eventListQB = this.otherListWangqi
              } else {
                this.otherListWangqi = this.otherListWangqi.concat(res.list);
                this.otherNoWangqi++;
                this.eventListQB = this.otherListWangqi
              }
            }
          }
        })
      },
      witchEvent(e) {
        this.noMoreEvent = '点击加载更多'
        if (e == 'jinqi') {
          this.witchGo = 'jinqi'
          if (this.event_type == '') {
            this.eventListQB = this.eventListJq
          } else if (this.event_type == 'pool') {
            this.eventListQB = this.poolListJq;
            if (this.poolNoJinqi == 1) {
              this.goEVENT_LIST();
            }
          } else if (this.event_type == 'study') {
            this.eventListQB = this.studyListJq;
            if (this.studyNoJinqi == 1) {
              this.goEVENT_LIST();
            }
          } else if (this.event_type == 'medicine') {
            this.eventListQB = this.medicineListJq;
            if (this.medicineNoJinqi == 1) {
              this.goEVENT_LIST();
            }
          } else if (this.event_type == 'other') {
            this.eventListQB = this.otherListJq;
            if (this.otherNoJinqi == 1) {
              this.goEVENT_LIST();
            }
          }
        } else if (e == 'wangqi') {
          this.witchGo = 'wangqi'
          if (this.event_type == '') {
            this.eventListQB = this.eventListWangqi
            if (this.allNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          } else if (this.event_type == 'pool') {
            this.eventListQB = this.poolListWangqi
            if (this.poolNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          } else if (this.event_type == 'study') {
            this.eventListQB = this.studyListWangqi
            if (this.studyNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          } else if (this.event_type == 'medicine') {
            this.eventListQB = this.medicineListWangqi
            if (this.medicineNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          } else if (this.event_type == 'other') {
            this.eventListQB = this.otherListWangqi
            if (this.otherNoWangqi == 1) {
              this.goEVENT_LISTWq();
            }
          }
        }
      },
      whichGoMore() {
//        加载跟多
//        判断执行往期的还是近期的请求
        if (this.event_type == '') {
          if (this.witchGo == 'jinqi') {
            this.allNoJinqi++
            this.pageNoJinqi = this.allNoJinqi
            this.goEVENT_LIST()
          } else if (this.witchGo == 'wangqi') {
//            this.allNoWangqi++
            this.pageNoWangqi = this.allNoWangqi
            this.goEVENT_LISTWq()
          }
        } else if (this.event_type == 'pool') {
          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.poolNoJinqi
            this.goEVENT_LIST()
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.poolNoWangqi
            this.goEVENT_LISTWq()
          }
        } else if (this.event_type == 'study') {
          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.studyNoJinqi
            this.goEVENT_LIST()
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.studyNoWangqi
            this.goEVENT_LISTWq()
          }
        } else if (this.event_type == 'medicine') {
          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.medicineNoJinqi
            this.goEVENT_LIST()
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.medicineNoWangqi
            this.goEVENT_LISTWq()
          }
        } else if (this.event_type == 'other') {
          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.otherNoJinqi
            this.goEVENT_LIST()
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.otherNoWangqi
            this.goEVENT_LISTWq()
          }
        }
      },
      goProject(e, zi) {
        // 转到项目详情页
//        let _this = this
        if (zi) {
          let a = e.split('event_id=')[1]
          this.$router.push({path: '/Project'})
          window.sessionStorage.setItem('event_id', a)
          return
        }
        this.$router.push({path: '/Project'})
        window.sessionStorage.setItem('event_id', e)
      },
      changeProjectType(e) {
        // 改变展示的类型
        this.noMoreEvent = '点击加载更多'
        let _this = this
        if (e == 'quanbu') {
          _this.event_type = ''

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.allNoJinqi
            if (this.allNoJinqi == 1) {
              this.eventListQB = this.eventListJq
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.eventListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.allNoWangqi
            if (this.allNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.eventListWangqi
            }
          }
          ;

          _this.quanbu = true
          _this.zhukun = false
          _this.zhuxue = false
          _this.zhuyi = false
          _this.qita = false
        } else if (e == 'zhukun') {
          _this.event_type = 'pool';

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.poolNoJinqi
            if (this.poolNoJinqi == 1) {
              this.eventListQB = this.poolListJq
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.poolListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.poolNoWangqi
            if (this.poolNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.poolListWangqi
            }
          }
          ;
          _this.quanbu = false
          _this.zhukun = true
          _this.zhuxue = false
          _this.zhuyi = false
          _this.qita = false
        } else if (e == 'zhuxue') {
          _this.event_type = 'study'

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.studyNoJinqi
            if (this.studyNoJinqi == 1) {
              this.eventListQB = this.studyListJq
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.studyListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.studyNoWangqi
            if (this.studyNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.studyListWangqi
            }
          }
          ;

          _this.quanbu = false
          _this.zhukun = false
          _this.zhuxue = true
          _this.zhuyi = false
          _this.qita = false
        } else if (e == 'zhuyi') {
          _this.event_type = 'medicine'

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.medicineNoJinqi
            if (this.medicineNoJinqi == 1) {
              this.eventListQB = this.medicineListJq
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.medicineListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.medicineNoWangqi
            if (this.medicineNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.medicineListWangqi
            }
          }
          ;

          _this.quanbu = false
          _this.zhukun = false
          _this.zhuxue = false
          _this.zhuyi = true
          _this.qita = false
        } else if (e == 'qita') {
          _this.event_type = 'other'

          if (this.witchGo == 'jinqi') {
            this.pageNoJinqi = this.otherNoJinqi
            if (this.otherNoJinqi == 1) {
              this.eventListQB = this.otherListJq
              this.goEVENT_LIST();
            } else {
              this.eventListQB = this.otherListJq
            }
          } else if (this.witchGo == 'wangqi') {
            this.pageNoWangqi = this.otherNoWangqi
            if (this.otherNoWangqi == 1) {
              this.goEVENT_LISTWq();
            } else {
              this.eventListQB = this.otherListWangqi
            }
          }
          ;

          _this.quanbu = false
          _this.zhukun = false
          _this.zhuxue = false
          _this.zhuyi = false
          _this.qita = true
        }
      }
    },
    watch: {
//      通过watch方法去观察index属性的变化，一旦变化让tab选中样式绑定的属性进行反转
      index() {
        let _this = this
        _this.isA = !_this.isA
        _this.isB = !_this.isB
      }
    }
  }
</script>
